<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Goods List</title>
<style type="text/css">
	.imageStyle {
		width: 220px;
    	height: 140px;
    }
</style>
</head>
<body>
<div class="container">
	<c:import url="./header.jsp"></c:import>
	<a href="./listCart">Go to Cart</a>
	<hr/>
	<table class="table table-striped">
		<thead>
			<tr>
				<td></td>
				<td>Name</td>
				<td>Description</td>
				<td>Price</td>
			</tr>
		</thead>
			<tbody>
				<c:forEach var="goods" items="${goodsList}">
					<tr>
						<td width="20%"><div><img class="imageStyle" src="./images/${goods.name }.jpg" /></div></td>
						<td width="20%">${goods.name }</td>
						<td width="30%">${goods.gdesc }</td>
						<td width="10%"><fmt:formatNumber value="${goods.price }" pattern="$#,###.00"></fmt:formatNumber></td>
						<td width="20%"><a class="btn btn-info" href="./pushToCart?id=${goods.id }">Add</a></td>
					</tr>
				</c:forEach>
			</tbody>
	</table>
</div>
</body>
</html>